/**
 * XRK-AGT葵崽 API控制中心
 * 主样式表 - 无遮罩层版本
 */

/* ==================== 全局变量 - 粉色梦幻系 ==================== */
:root {
    /* 粉色梦幻系深色主题 - 深紫粉色背景 */
    --bg-primary: transparent; /* 透明，让背景图可见 */
    --bg-secondary: rgba(247, 112, 184, 0.15);
    --bg-tertiary: rgba(140, 114, 236, 0.15);
    --bg-card: rgba(30, 25, 45, 0.75); /* 暗色主题：深色卡片背景，增强对比度 */
    --bg-hover: rgba(40, 35, 55, 0.85); /* 暗色主题：更深的悬停背景 */
    
    /* 字体颜色 - 暗色主题：亮色文字，确保在深色背景上清晰可见 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.8);
    --text-dim: rgba(255, 255, 255, 0.65);
    
    /* 粉色梦幻系主色调 */
    --accent: #ff67b8;
    --accent-hover: #ff4da6;
    --accent-light: rgba(255, 103, 184, 0.3);
    --accent-glow: rgba(255, 103, 184, 0.5);
    
    /* 粉色高亮色 */
    --pink-bright: #ff67b8;
    --pink-bright-light: rgba(255, 103, 184, 0.3);
    
    /* 紫色辅助色 */
    --purple-accent: #8c72ec;
    --purple-accent-light: rgba(140, 114, 236, 0.3);
    
    /* 状态颜色 - 粉色梦幻系 */
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.3);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.3);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.3);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.3);
    
    --border: rgba(255, 255, 255, 0.3);
    --border-light: rgba(255, 255, 255, 0.2);
    
    /* 粉色梦幻系渐变 */
    --gradient-primary: linear-gradient(135deg, #ff67b8 0%, #8c72ec 50%, #57c2ff 100%);
    --gradient-pink: linear-gradient(135deg, #ff67b8 0%, #ff4da6 50%, #ff2d94 100%);
    --gradient-success: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-warm: linear-gradient(135deg, #ff67b8, #8c72ec, #57c2ff);
    
    --shadow-sm: 0 2px 8px rgba(255, 103, 184, 0.2);
    --shadow-md: 0 4px 20px rgba(255, 103, 184, 0.3);
    --shadow-lg: 0 10px 40px rgba(255, 103, 184, 0.4);
    --shadow-xl: 0 20px 60px rgba(255, 103, 184, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --sidebar-width: 320px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================== 首页状态卡统一交互 ==================== */
/* 注意：.status-card-large 的统一样式在上面定义，这里只保留特殊样式 */
.status-card-header h3 {
    font-size: 16px;
    letter-spacing: 0.2px;
}
.status-card-content { margin-top: 10px; }

/* 亮色主题配色 - 粉色梦幻系亮色版，增强对比度 */
body.light {
    --bg-primary: transparent;
    --bg-secondary: rgba(255, 200, 230, 0.5);
    --bg-tertiary: rgba(220, 200, 255, 0.5);
    --bg-card: rgba(255, 255, 255, 0.9); /* 亮色主题：更亮的卡片背景，增强对比度 */
    --bg-hover: rgba(255, 255, 255, 0.95); /* 亮色主题：更亮的悬停背景 */
    
    /* 亮色主题：深色文字，确保在浅色背景上清晰可见 */
    --text-primary: #1a0a1e;
    --text-secondary: #2d1a2e;
    --text-muted: #4a2a4a;
    --text-dim: #6a4a6a;
    
    --accent: #e6399b;
    --accent-hover: #d12a8a;
    --accent-light: rgba(230, 57, 155, 0.25);
    --accent-glow: rgba(230, 57, 155, 0.5);
    
    --border: rgba(230, 57, 155, 0.4);
    --border-light: rgba(230, 57, 155, 0.2);
    
    --shadow-sm: 0 2px 8px rgba(230, 57, 155, 0.2);
    --shadow-md: 0 4px 20px rgba(230, 57, 155, 0.3);
    --shadow-lg: 0 10px 40px rgba(230, 57, 155, 0.35);
    --shadow-xl: 0 20px 60px rgba(230, 57, 155, 0.4);
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: inherit;
}

/* ==================== 基础样式 ==================== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    /* body不设置背景图，背景图只在主内容区域显示 */
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    position: relative;
    overflow-x: hidden;
}

/* 背景遮罩层 - 只在主内容区域显示，侧边栏和顶部栏不显示 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 暗色主题：深色遮罩 */
    background: linear-gradient(135deg,
        rgba(20, 20, 40, 0.85) 0%,
        rgba(30, 25, 50, 0.85) 50%,
        rgba(25, 30, 45, 0.85) 100%);
    background-size: 200% 200%;
    animation: shine 3s infinite linear;
    z-index: 0;
    pointer-events: none;
}

body.light::before {
    /* 亮色主题：浅色遮罩 */
    background: linear-gradient(135deg,
        rgba(255, 240, 250, 0.6) 0%,
        rgba(240, 235, 255, 0.6) 50%,
        rgba(235, 245, 255, 0.6) 100%);
    background-size: 200% 200%;
}

@keyframes shine {
    0% {
        background-position: 0% 0%;
    }
    50% { 
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* 粒子背景 - 在主内容区域之上，背景图之上，内容之下 */
#bgParticles {
    position: fixed;
    left: var(--sidebar-width); /* 从侧边栏右侧开始 */
    top: 0;
    right: 0;
    bottom: 0;
    width: calc(100vw - var(--sidebar-width));
    height: 100vh;
    z-index: 3; /* 在背景图(z-index:1)和遮罩层(z-index:0)之上，但在内容(z-index:2+)之下 */
    pointer-events: none;
    opacity: 0.9; /* 增加不透明度，让粒子更明显 */
    }

/* 移除冗余的sunflowerFloat动画，使用shine动画替代 */

/* ==================== 情绪展示区 ==================== */
.emotion-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: 8px 0 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px dashed var(--border);
}

.emotion-icon {
    font-size: clamp(48px, 7vw, 96px);
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15));
    user-select: none;
    transition: transform 0.3s ease, opacity 0.2s ease, filter 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

/* 表情动画效果 */
@keyframes emotionBounce {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.2) translateY(-10px); }
}

@keyframes emotionPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes emotionShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

@keyframes emotionRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes emotionFade {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.emotion-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

@keyframes lineMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

/* ==================== 容器布局 ==================== */
/* 层级规则：
   - body背景图: 最底层（无z-index）
   - body::before遮罩: z-index: 0
   - #bgParticles粒子: z-index: 1
   - .app-container内容: z-index: 2
*/
.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 2; /* 内容在最上层 */
}

/* 主内容区域定义在下方，这里删除重复定义 */

/* 内容卡片 - 使用统一的卡片背景色 */
.content-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* 亮色主题：内容卡片边框和阴影 */
body.light .content-card {
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 2;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* 侧边栏边缘效果 - 使用背景图边缘颜色填充，过渡更自然 */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100px;
    width: 200px;
    height: 100%;
    /* 使用背景图的边缘颜色（粉色和紫色）创建渐变过渡 */
    background: linear-gradient(to right,
        rgba(255, 103, 184, 0.4) 0%,
        rgba(255, 103, 184, 0.25) 15%,
        rgba(140, 114, 236, 0.2) 30%,
        rgba(140, 114, 236, 0.1) 50%,
        transparent 80%);
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 4s ease-in-out infinite;
    filter: blur(12px); /* 增加模糊效果，让过渡更自然 */
}

body.light .sidebar::before {
    background: linear-gradient(to right,
        rgba(255, 182, 218, 0.5) 0%,
        rgba(255, 182, 218, 0.3) 15%,
        rgba(200, 181, 255, 0.25) 30%,
        rgba(200, 181, 255, 0.15) 50%,
        transparent 80%);
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.03);
    }
}

/* 优化动画性能 */
@keyframes smoothFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes smoothScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 删除冗余的sidebar渐变，避免遮挡背景图 */

.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
    z-index: 1; /* 确保在光芒效果之上 */
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 46px;
    height: 46px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: var(--shadow-glow);
    position: relative;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 5px 15px var(--accent-glow);
    }
    50% { 
        transform: translateY(-2px) rotate(3deg);
        box-shadow: 0 12px 25px var(--accent-glow);
    }
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0;
    }
    50% { 
        transform: scale(1.15);
        opacity: 0.25;
    }
}

/* 主题切换 */
.theme-toggle {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    cursor: pointer;
    padding: 4px;
    transition: all var(--transition-base);
    border: 1px solid var(--border);
    overflow: hidden;
}

.theme-toggle:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffd89b, #19547b);
    border-radius: 50%;
    transition: all var(--transition-bounce);
    position: relative;
}

.theme-toggle-thumb::before {
    content: '🌙';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

body.light .theme-toggle-thumb {
    transform: translateX(24px);
    background: linear-gradient(135deg, #ffd89b, #ffaa00);
}

body.light .theme-toggle-thumb::before {
    content: '☀️';
}

/* 侧边栏导航 */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 16px;
    position: relative;
    z-index: 1; /* 确保在光芒效果之上 */
}

.nav-item {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

/* 删除半框预设动画 */
.nav-item::before {
    display: none; /* 删除半框预设 */
}

.nav-item:hover {
    transform: translateX(3px); /* 轻微右移 */
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(255, 103, 184, 0.3); /* 添加阴影效果 */
    background: rgba(255, 103, 184, 0.1); /* 轻微背景色变化 */
}

.nav-item.active {
    background: var(--gradient-pink);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(255, 103, 184, 0.4);
}

.nav-item.active::before {
    display: none; /* 删除半框预设 */
}

/* 导航图标 - 使用线条装饰 */
.nav-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.nav-item[data-page="home"] .nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 4px;
    box-sizing: border-box;
}

.nav-item[data-page="home"] .nav-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 2px;
}

.nav-item[data-page="chat"] .nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    border: 2px solid currentColor;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
}

.nav-item[data-page="chat"] .nav-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 30%;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
}

.nav-item[data-page="config"] .nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 2px;
    box-sizing: border-box;
}

.nav-item[data-page="config"] .nav-icon::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    border-radius: 1px;
    box-sizing: border-box;
}

.nav-item[data-page="api"] .nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 2px;
    box-sizing: border-box;
}

.nav-item[data-page="api"] .nav-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid currentColor;
}

.nav-text {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

/* API分组 */
.api-groups-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
    position: relative;
    z-index: 1; /* 确保在光芒效果之上 */
}

.api-groups-container::-webkit-scrollbar {
    width: 6px;
}

.api-groups-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 3px;
}

.api-groups-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.api-group {
    margin-bottom: 28px;
    animation: slideInLeft 0.4s ease-out backwards;
}

.api-group:nth-child(1) { animation-delay: 0.05s; }
.api-group:nth-child(2) { animation-delay: 0.1s; }
.api-group:nth-child(3) { animation-delay: 0.15s; }
.api-group:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.api-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    margin-bottom: 12px;
    padding-left: 12px;
    position: relative;
}

.api-group-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 12px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.api-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 6px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.api-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.api-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.api-item:hover {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    transform: translateX(8px);
}

.api-item:hover::before {
    transform: scaleY(1);
}

.api-item.active {
    background: transparent;
    color: white;
}

.api-item.active::after {
    opacity: 1;
}

.api-item.touch-active {
    transform: scale(0.96);
}

.method-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    min-width: 54px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.method-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0.2;
    z-index: -1;
}

.method-get { 
    background: var(--success);
    color: white;
}

.method-post { 
    background: var(--accent);
    color: white;
}

.method-put { 
    background: var(--warning);
    color: white;
}

.method-delete { 
    background: var(--danger);
    color: white;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 背景图只在主内容区域显示，从侧边栏右侧开始，自然充满整个区域 */
    background-image: url('./img/bg.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    /* 确保背景图在遮罩层之上 */
    z-index: 1;
    /* 确保背景图覆盖整个区域 */
    min-height: 100vh;
}

/* 主内容区域的背景遮罩，让文字更清晰 */
.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 暗色主题：深色遮罩 */
    background: linear-gradient(135deg,
        rgba(20, 20, 40, 0.3) 0%,
        rgba(30, 25, 50, 0.3) 50%,
        rgba(25, 30, 45, 0.3) 100%);
    z-index: 0;
    pointer-events: none;
}

body.light .main-content::before {
    /* 亮色主题：浅色遮罩 */
    background: linear-gradient(135deg,
        rgba(255, 240, 250, 0.2) 0%,
        rgba(240, 235, 255, 0.2) 50%,
        rgba(235, 245, 255, 0.2) 100%);
}

/* 确保主内容区域的子元素在遮罩层之上 */
.main-content > * {
    position: relative;
    z-index: 1;
}

/* 头部 - 使用半透明背景，让背景图可见 */
.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 24px 28px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 顶部栏边缘效果 - 使用背景图边缘颜色填充，过渡更自然 */
.header::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 150px;
    /* 使用背景图的边缘颜色（粉色和紫色）创建渐变过渡 */
    background: linear-gradient(to bottom,
        rgba(255, 103, 184, 0.4) 0%,
        rgba(255, 103, 184, 0.25) 15%,
        rgba(140, 114, 236, 0.2) 30%,
        rgba(140, 114, 236, 0.1) 50%,
        transparent 80%);
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 4s ease-in-out infinite;
    filter: blur(12px); /* 增加模糊效果，让过渡更自然 */
}

body.light .header::before {
    background: linear-gradient(to bottom,
        rgba(255, 182, 218, 0.5) 0%,
        rgba(255, 182, 218, 0.3) 15%,
        rgba(200, 181, 255, 0.25) 30%,
        rgba(200, 181, 255, 0.15) 50%,
        transparent 80%);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-warm);
    opacity: 0.3;
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.api-key-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 300px;
    max-width: 540px;
}

.api-key-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex: 1;
    transition: all var(--transition-base);
    position: relative;
}

.api-key-input::before {
    content: '🔑';
    font-size: 18px;
    opacity: 0.5;
}

.api-key-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    transform: translateY(-2px);
}

.api-key-input input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
    outline: none;
    flex: 1;
    min-width: 0;
}

.api-key-input input::placeholder {
    color: var(--text-dim);
}

.api-key-input button {
    padding: 7px 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-key-input button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.api-key-input button:active {
    transform: scale(0.98);
}

.status-cards {
    display: flex;
    gap: 14px;
    align-items: center;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-base);
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-base);
    position: relative;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 0 var(--success);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 var(--success);
    }
    70% {
        box-shadow: 0 0 0 8px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

/* ==================== 内容区 ==================== */
.content {
    flex: 1;
    padding: 20px; /* 缩小内边距，充分利用空间 */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    background: transparent; /* 透明背景，让背景图可见 */
    z-index: 2;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
}

/* API 响应 Key-Value 表 */
.kv-table-wrap { margin: 14px 0 18px; overflow-x: auto; }
.kv-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); }
.kv-table th, .kv-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.kv-table th { width: 120px; color: var(--text-muted); background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; }
.kv-table.small th { width: 200px; }
.break-all { word-break: break-all; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .kv-table th { width: 90px; font-size: 12px; }
  .kv-table td { font-size: 12px; }
}

/* ==================== 欢迎屏幕 ==================== */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 200px);
    text-align: center;
    padding: 40px 20px;
    animation: welcomeFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    background: transparent; /* 透明背景，让背景图可见 */
}

@keyframes welcomeFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.welcome-icon {
    font-size: 96px;
    margin-bottom: 32px;
    animation: welcomeIconFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px var(--accent-glow));
}

@keyframes welcomeIconFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1); 
    }
    25% { 
        transform: translateY(-8px) rotate(-3deg) scale(1.03); 
    }
    75% { 
        transform: translateY(-4px) rotate(3deg) scale(1.01); 
    }
}

.welcome-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGradient 8s linear infinite;
    letter-spacing: -1px;
    /* 暗色主题：粉色阴影增强可读性 */
    text-shadow: 0 2px 10px rgba(255, 103, 184, 0.5);
}

/* 亮色主题：深色阴影增强可读性 */
body.light .welcome-title {
    text-shadow: 0 2px 8px rgba(230, 57, 155, 0.6);
}

@keyframes titleGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.welcome-desc {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 56px;
    max-width: 600px;
    line-height: 1.8;
    /* 暗色主题：深色阴影增强可读性 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 亮色主题：浅色阴影增强可读性 */
body.light .welcome-desc {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 首页概览摘要 */
.status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 0 0 18px 0;
}
.summary-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2), 0 4px 5px rgba(0, 0, 0, 0.3);
}
.summary-label { color: var(--text-primary); font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.summary-value { font-size: 18px; font-weight: 700; color: var(--pink-bright); }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; /* 缩小间距，充分利用空间 */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 40px; /* 缩小底部间距 */
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px; /* 缩小内边距，充分利用空间 */
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
    animation: statCardSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* 亮色主题：统计卡片边框和阴影 */
body.light .stat-card {
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes statCardSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 42px;
    margin-bottom: 16px;
    animation: statIconBounce 0.8s ease-out;
    display: inline-block;
}

@keyframes statIconBounce {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.stat-card:hover .stat-icon {
    animation: statIconSpin 1s ease-in-out;
}

/* 首页卡片栅格与通用布局 */


@keyframes statIconSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.stat-value {
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    transition: all var(--transition-base);
}

.stat-label {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* 增强可读性 */
}

/* 快速操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; /* 缩小间距，充分利用空间 */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.quick-action {
    padding: 20px; /* 缩小内边距，充分利用空间 */
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    animation: quickActionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.quick-action:nth-child(1) { animation-delay: 0.1s; }
.quick-action:nth-child(2) { animation-delay: 0.15s; }
.quick-action:nth-child(3) { animation-delay: 0.2s; }
.quick-action:nth-child(4) { animation-delay: 0.25s; }

@keyframes quickActionPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quick-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
    z-index: -1;
}

.quick-action:hover {
    transform: translateY(-6px) rotate(2deg);
    border-color: var(--accent);
    color: white;
    box-shadow: var(--shadow-lg);
}

.quick-action:hover::before {
    width: 300px;
    height: 300px;
}

.quick-action-icon {
    font-size: 36px;
    margin-bottom: 12px;
    transition: transform var(--transition-bounce);
}

.quick-action:hover .quick-action-icon {
    transform: scale(1.3) rotate(360deg);
}

.quick-action-text {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== AI 聊天 ==================== */
.ai-chat-container {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: chatSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.ai-chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-pink);
    transform: scaleX(0);
    transform-origin: left;
    animation: chatHeaderLine 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes chatHeaderLine {
    to {
        transform: scaleX(1);
    }
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.ai-chat-title {
    font-size: 18px;
    font-weight: 700;
}
.ai-chat-body {
    margin-top: 14px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 420px;
    overflow-y: auto;
}
.chat-msg {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 10px 0;
    max-width: 80%;
    line-height: 1.7;
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    word-wrap: break-word;
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.chat-msg.user {
    background: var(--gradient-pink);
    color: var(--text-primary);
    margin-left: auto;
    border: 1px solid var(--accent);
    box-shadow: 0 2px 8px rgba(244, 164, 96, 0.3);
    position: relative;
}

.chat-msg.user::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--accent);
}
.chat-msg.assistant {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    margin-right: auto;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.chat-msg.assistant::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--bg-secondary);
}
.chat-msg.assistant.streaming {
    border-style: dashed;
    opacity: 0.95;
    position: relative;
}

.chat-msg.assistant.streaming::after {
    content: '...';
    animation: typingDots 1.4s steps(4, end) infinite;
    display: inline-block;
    width: 20px;
    margin-left: 4px;
}

@keyframes typingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
.ai-chat-input-container {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

.ai-chat-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.ai-chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    transform: translateY(-2px);
}

.ai-chat-send {
    padding: 14px 24px;
    background: var(--gradient-pink);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.ai-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ai-chat-send:active {
    transform: translateY(0);
}

/* 麦克风图标 */
.mic-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    position: relative;
    margin-right: 6px;
    vertical-align: middle;
}

.mic-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 4px 4px 0 0;
    box-sizing: border-box;
}

.mic-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
}

#micToggleBtn.recording .mic-icon::before {
    animation: micPulse 1s ease-in-out infinite;
}

#micToggleBtn.recording .mic-icon::after {
    animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.1);
    }
}

/* ==================== API测试界面 ==================== */
.api-test-container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 32px;
    animation: containerFadeIn 0.4s ease-out;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2), 0 4px 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.api-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.api-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--gradient-warm);
    border-radius: 2px;
}

.api-title {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.api-endpoint {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 17px;
    color: var(--text-primary);
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.api-endpoint:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.api-desc {
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* 增强可读性 */
}

/* 双栏布局 */
.api-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1280px) {
    .api-content-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.params-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.preview-column {
    position: sticky;
    top: 32px;
    height: fit-content;
}

.params-section {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    animation: sectionSlideIn 0.4s ease-out backwards;
}

.params-section:nth-child(1) { animation-delay: 0.1s; }
.params-section:nth-child(2) { animation-delay: 0.2s; }
.params-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes sectionSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.params-section:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.section-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 12px;
}

/* 区域图标 - 使用线条装饰替代emoji */
.section-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
}

.section-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 4px;
    box-sizing: border-box;
    animation: iconPulse 2s ease-in-out infinite;
}

.section-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
}

.file-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
}

.file-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80%;
    border: 2px solid var(--accent);
    border-radius: 2px 2px 0 0;
    box-sizing: border-box;
}

.file-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    border: 2px solid var(--accent);
    border-top: none;
    border-radius: 0 0 2px 2px;
    box-sizing: border-box;
}

/* 按钮图标样式 */
.btn-icon {
    display: inline-block;
    position: relative;
}

.check-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
    position: relative;
}

.check-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--success);
    border-radius: 2px;
    box-sizing: border-box;
}

.check-icon::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: 2px solid var(--success);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    box-sizing: border-box;
}

@keyframes iconWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.param-grid {
    display: grid;
    gap: 24px;
}

.param-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    animation: paramFadeIn 0.3s ease-out backwards;
}

@keyframes paramFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.param-label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.param-label .required {
    color: var(--danger);
    font-weight: 700;
    animation: requiredPulse 2s ease-in-out infinite;
}

@keyframes requiredPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.param-hint {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 400;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.input-field {
    padding: 14px 18px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-base);
    width: 100%;
}

.input-field:hover {
    border-color: var(--text-muted);
}

.input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

textarea.input-field {
    min-height: 140px;
    resize: vertical;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* JSON编辑器 */
.json-editor {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    height: fit-content;
    transition: all var(--transition-base);
    animation: editorSlideIn 0.5s ease-out backwards;
    animation-delay: 0.3s;
}

@keyframes editorSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.json-editor:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.editor-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-controls {
    display: flex;
    gap: 10px;
}

.editor-btn {
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-btn:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.editor-btn:active {
    transform: scale(0.96);
}

.json-editor-wrapper {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

/* 当 CodeMirror 尚未加载时，textarea 作为回退显示，需与主题一致，避免白块 */
.json-editor-wrapper textarea {
    display: block;
    width: 100%;
    height: 420px;
    padding: 12px 14px;
    background: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.8;
}

/* CodeMirror样式 */
.CodeMirror {
    height: 420px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.8;
    background: transparent;
}

.CodeMirror-gutters {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
}

.CodeMirror-linenumber {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-weight: 500;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--accent);
}

.CodeMirror-selected {
    background: var(--accent-light);
}

/* 文件上传 */
.file-upload {
    position: relative;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 40px;
    background: transparent;
    border: 3px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.file-upload-label::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.file-upload-label:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.file-upload-label:hover::before {
    opacity: 0.05;
}

.file-upload-label.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    animation: uploadPulse 1s ease-in-out infinite;
}

@keyframes uploadPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* 文件上传图标 - 使用线条装饰替代emoji */
.file-upload-icon {
    display: inline-block;
    width: 56px;
    height: 56px;
    position: relative;
    margin-bottom: 16px;
    animation: uploadIconBounce 0.8s ease-out;
}

.file-upload-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 32px;
    border: 3px solid var(--accent);
    border-radius: 4px 4px 0 0;
    box-sizing: border-box;
}

.file-upload-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 24px;
    border: 3px solid var(--accent);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
}

@keyframes uploadIconBounce {
    0% { transform: translateY(-100px) scale(0); }
    50% { transform: translateY(10px) scale(1.2); }
    100% { transform: translateY(0) scale(1); }
}

/* 删除图标 - 使用线条装饰 */
.remove-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    position: relative;
}

.remove-icon::before,
.remove-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 12px;
    background: var(--danger);
    transform: translate(-50%, -50%) rotate(45deg);
}

.remove-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.file-upload-text {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 17px;
    font-weight: 500;
}

.file-list {
    margin-top: 20px;
    padding: 20px;
    background: transparent;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    gap: 14px;
    animation: fileItemSlide 0.3s ease-out;
    transition: all var(--transition-base);
}

@keyframes fileItemSlide {
    from { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.file-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-weight: 500;
}

.file-size {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-size: 13px;
    white-space: nowrap;
}

.file-remove {
    padding: 8px;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all var(--transition-base);
}

.file-remove:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg) scale(1.2);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 16px;
    margin-top: 36px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, #4dc6ff, #ff67b8);
    color: white;
    box-shadow: 0 4px 15px rgba(77, 198, 255, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(77, 198, 255, 0.6);
    background: linear-gradient(135deg, #5dd5ff, #ff77c8);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* 响应结果 */
.response-section {
    margin-top: 56px;
    animation: responseSlideUp 0.4s ease-out;
}

@keyframes responseSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(40px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}

.response-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.response-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-badge {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: statusBadgePop 0.3s ease-out;
}

@keyframes statusBadgePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.status-success {
    background: var(--success-light);
    color: var(--success);
    border: 2px solid var(--success);
}

.status-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.response-time {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-size: 15px;
    font-weight: 600;
}

.code-viewer {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-height: 640px;
    position: relative;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.code-language {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.copy-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-btn:hover {
    background: var(--gradient-success);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#responseContent {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.8;
    overflow: auto;
    max-height: 520px;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

/* JSON语法高亮 */
.json-key { 
    color: #f92672;
    font-weight: 600;
}

.json-string { 
    color: #a6e22e;
}

.json-number { 
    color: #ae81ff;
}

.json-boolean { 
    color: #66d9ef;
}

.json-null { 
    color: #75715e;
    font-style: italic;
}

body.light .json-key { 
    color: #d73a49;
}

body.light .json-string { 
    color: #032f62;
}

body.light .json-number { 
    color: #005cc5;
}

body.light .json-boolean { 
    color: #d73a49;
}

body.light .json-null { 
    color: #6a737d;
}

/* 数据可视化 */
.data-visualization {
    margin-top: 40px;
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; /* 缩小间距，充分利用空间 */
    margin-top: 16px; /* 缩小顶部间距 */
}

.bot-card {
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--border); /* 统一边框样式 */
    border-radius: var(--radius-lg);
    padding: 20px; /* 统一内边距 */
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    animation: botCardFadeIn 0.5s ease-out backwards;
    position: relative;
    overflow: hidden;
}

/* 亮色主题：机器人卡片统一样式 */
body.light .bot-card {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.bot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.bot-card:hover {
    transform: translateY(-6px) scale(1.01); /* 统一悬停效果 */
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    background: var(--bg-hover); /* 使用统一的悬停背景 */
}

.bot-card:hover::before {
    transform: scaleX(1);
}

.bot-card:nth-child(1) { animation-delay: 0.1s; }
.bot-card:nth-child(2) { animation-delay: 0.15s; }
.bot-card:nth-child(3) { animation-delay: 0.2s; }
.bot-card:nth-child(4) { animation-delay: 0.25s; }

@keyframes botCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bot-avatar {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--accent-glow);
    animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-status.online {
    color: var(--success);
    border: 1px solid var(--success);
}

.bot-status.offline {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    border: 1px solid var(--text-muted);
}

.bot-info {
    margin-top: 16px;
}

.bot-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.bot-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.bot-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bot-detail-label {
    font-size: 12px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-detail-value {
    font-size: 17px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-tertiary);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: loadingSpin 0.8s linear infinite;
}

@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

/* Toast通知 - 在主内容区域居中显示 */
#toastContainer {
    position: fixed;
    bottom: 32px;
    left: var(--sidebar-width); /* 从侧边栏右侧开始 */
    right: 0; /* 到屏幕右边缘 */
    max-width: 500px;
    margin: 0 auto;
    pointer-events: none;
    z-index: 10000;
    /* 确保在主内容区域内居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-right: 32px;
    box-sizing: border-box;
}

.toast {
    padding: 18px 24px;
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 4px solid var(--border);
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all var(--transition-base);
    opacity: 1; /* 初始状态可见 */
    max-width: 100%;
    box-sizing: border-box;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast.hide {
    animation: toastSlideOut 0.4s ease-in;
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 28px;
    animation: toastIconRotate 0.6s ease-out;
}

@keyframes toastIconRotate {
    from { transform: rotate(-360deg) scale(0); }
    to { transform: rotate(0deg) scale(1); }
}

.toast.success { 
    border-left-color: var(--success);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), var(--success-light));
}

.toast.error { 
    border-left-color: var(--danger);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), var(--danger-light));
}

.toast.warning { 
    border-left-color: var(--warning);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), var(--warning-light));
}

.toast.info { 
    border-left-color: var(--info);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), var(--info-light));
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

/* ==================== 悬浮球 ==================== */
.floating-btn {
    display: none;
    position: fixed;
    width: 64px;
    height: 64px;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF8C00);
    border: none;
    border-radius: 50%;
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.4);
    cursor: pointer;
    touch-action: none;
    transition: all var(--transition-smooth);
    -webkit-user-select: none;
    user-select: none;
    z-index: 10000;
    overflow: hidden;
    isolation: isolate;
    animation: floatingBtnEntrance 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes floatingBtnEntrance {
    from {
        transform: translateY(-50%) scale(0) rotate(-180deg);
    }
    to {
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
}

.floating-btn::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: inherit;
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
    animation: floatingRipple 3s ease-in-out infinite;
}

@keyframes floatingRipple {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.floating-btn:hover {
    transform: translateY(-50%) scale(1.1) rotate(15deg);
    box-shadow: 0 8px 32px var(--accent-glow);
    border-color: var(--pink-bright);
}

.floating-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.floating-btn.dragging {
    transition: none;
    box-shadow: 0 10px 40px var(--accent-glow);
    animation: none;
}

.sunflower-icon {
    width: 44px;
    height: 44px;
    animation: sunflowerRotate 15s linear infinite;
    transition: transform var(--transition-smooth);
}

@keyframes sunflowerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.floating-btn:hover .sunflower-icon {
    animation-duration: 8s;
    transform: scale(1.1);
}

.floating-btn.dragging .sunflower-icon {
    animation-play-state: paused;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 85%;
    }

    /* 移动端：粒子效果覆盖整个屏幕 */
    #bgParticles {
        left: 0;
        width: 100vw;
        z-index: 3; /* 确保在移动端也在背景图之上 */
    }

    .floating-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-width);
        max-width: 320px;
        height: 100vh;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
        transform: translateX(-100%);
        z-index: 10001;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        /* 移动端：背景图使用cover确保充满屏幕，并裁切多余部分 */
        background-size: cover;
        background-position: center center;
        min-height: 100vh; /* 确保背景图覆盖整个屏幕 */
    }

    .header {
        padding: 20px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .api-key-section {
        width: 100%;
        max-width: none;
    }

    .status-cards {
        justify-content: center;
    }

    .content {
        padding: 12px; /* 减小内边距，充分利用屏幕 */
        padding-bottom: 120px;
    }

    .api-content-grid {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: static;
        margin-top: 32px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bot-grid {
        grid-template-columns: 1fr;
    }

    #toastContainer {
        bottom: 120px;
        left: 0; /* 移动端：从屏幕左边缘开始 */
        right: 0; /* 移动端：到屏幕右边缘 */
        max-width: 100%;
        padding: 0 20px;
        align-items: center;
    }

    .CodeMirror {
        height: 320px;
    }

    .welcome-screen {
        min-height: calc(100vh - 120px);
        padding: 20px 12px; /* 减小内边距，充分利用屏幕 */
    }

    /* 配置编辑器移动端优化 - 最大化可操作区域 */
    .config-editor-container {
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .config-editor-header {
        padding: 12px 16px;
        flex-shrink: 0;
    }

    .config-editor-title {
        font-size: 16px;
        font-weight: 500;
    }
    
    .config-editor-panel {
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .config-editor-toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 12px 16px;
        margin-bottom: 0;
        flex-shrink: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-light);
    }

    .config-editor-name {
        font-size: 15px;
        margin-bottom: 0;
        font-weight: 600;
    }

    .config-editor-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .config-editor-actions .btn {
        flex: 1;
        min-width: 0;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 500;
        border-radius: var(--radius-md);
    }

    .config-editor-content {
        flex: 1;
        padding: 0;
        padding-bottom: 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .config-form-scroll {
        padding: 8px 6px; /* 大幅减小内边距，增加可操作区域 */
        padding-bottom: 120px; /* 减小底部内边距 */
        min-height: 100%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* 防止水平滚动 */
    }
    
    .sub-config-list-scroll {
        padding: 8px 6px; /* 大幅减小内边距 */
        padding-bottom: 120px; /* 减小底部内边距 */
        min-height: 100%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* 防止水平滚动 */
    }

    .config-form-field {
        padding: 12px 8px; /* 大幅减小内边距，增加可操作区域 */
        margin-bottom: 10px; /* 减小间距 */
        margin-left: 0;
        margin-right: 0;
        background: var(--bg-card);
        border-radius: var(--radius-sm); /* 使用更小的圆角 */
        border: 1px solid var(--border-light);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .config-form-label {
        font-size: 13px; /* 减小字体 */
        font-weight: 500;
        margin-bottom: 6px; /* 减小间距 */
        display: block;
    }

    .config-form-input,
    .config-form-select {
        padding: 10px 12px; /* 减小内边距 */
        font-size: 14px; /* 减小字体，更适合手机 */
        width: 100%;
        border-radius: var(--radius-sm); /* 使用更小的圆角 */
        border: 1px solid var(--border);
        background: var(--bg-secondary);
        transition: all var(--transition-base);
    }

    .config-form-input:focus,
    .config-form-select:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-light);
    }

    .config-form-array-item {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        background: var(--bg-secondary);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
    }

    .config-form-array-item input {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        margin-bottom: 10px;
    }

    .config-form-array-remove,
    .config-form-arrayform-remove {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }

    .config-form-array-add,
    .config-form-arrayform-add {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
        margin-left: 0;
        margin-right: 0;
        min-height: 48px; /* 确保按钮足够大，易于点击 */
        touch-action: manipulation; /* 优化触摸响应 */
        box-sizing: border-box; /* 确保padding包含在宽度内 */
    }

    .config-form-subform {
        padding: 10px 8px; /* 大幅减小内边距 */
        margin-top: 8px; /* 减小间距 */
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 8px;
        background: var(--bg-secondary);
        border-radius: var(--radius-sm); /* 使用更小的圆角 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .config-form-subfield {
        margin-bottom: 10px; /* 减小间距 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .config-form-subfield:last-child {
        margin-bottom: 0;
    }
    
    /* 确保子字段内的所有元素都不超出容器 */
    .config-form-subfield * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .config-form-subfield .config-form-label {
        font-size: 12px; /* 减小标签字体 */
        margin-bottom: 4px; /* 减小间距 */
    }

    .config-form-arrayform-item {
        padding: 10px 8px; /* 大幅减小内边距 */
        margin-bottom: 10px; /* 减小间距 */
        margin-left: 0;
        margin-right: 0;
        background: var(--bg-secondary);
        border-radius: var(--radius-sm); /* 使用更小的圆角 */
        min-height: 50px; /* 减小最小高度 */
        display: flex;
        flex-direction: column;
        gap: 8px; /* 减小间距 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box; /* 确保padding包含在宽度内 */
    }

    .config-form-arrayform-actions {
        margin-top: 12px;
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .config-form-arrayform-remove {
        min-height: 44px; /* 确保删除按钮足够大 */
        padding: 12px 20px;
        touch-action: manipulation;
        flex-shrink: 0; /* 防止按钮被压缩 */
    }

    .config-form-switch {
        width: 56px;
        height: 32px;
    }

    .config-form-switch-slider:before {
        height: 24px;
        width: 24px;
    }

    .config-form-checkbox:checked + .config-form-switch-slider:before {
        transform: translateX(24px);
    }

    .config-form-tags {
        margin-top: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .config-form-tags-list {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .config-form-tags-input-wrapper {
        margin-top: 12px;
        display: flex;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .config-form-tags-input {
        flex: 1;
        padding: 14px 16px;
        font-size: 16px;
        min-width: 0; /* 允许flex item缩小 */
        box-sizing: border-box;
    }

    .config-form-tags-add {
        padding: 14px 20px;
        font-size: 14px;
        min-width: 80px;
        flex-shrink: 0; /* 防止按钮被压缩 */
        box-sizing: border-box;
    }

    .config-form-hint {
        font-size: 13px;
        color: var(--text-muted);
        margin-top: 6px;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .config-list-panel {
        padding: 16px;
        padding-bottom: 140px;
        min-height: 100%;
    }

    .config-item {
        padding: 20px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 16px;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
    }

    .config-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .config-item-actions .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 100px;
    }

    .sub-config-list-scroll {
        padding: 16px;
        padding-bottom: 140px;
        min-height: 100%;
    }
    
    .sub-config-list {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0;
    }

    .sub-config-item {
        padding: 20px 16px;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
        transition: all var(--transition-base);
    }

    .sub-config-item:active {
        transform: scale(0.98);
        background: var(--bg-hover);
    }

    .sub-config-name {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 6px;
    }

    .sub-config-desc {
        font-size: 14px;
        color: var(--text-muted);
        margin-bottom: 8px;
    }

    .sub-config-path {
        font-size: 12px;
        color: var(--text-dim);
        font-family: 'Courier New', monospace;
    }
}

@media (max-width: 480px) {
    .main-content {
        /* 小屏幕移动端：确保背景图充满屏幕，使用cover裁切 */
        background-size: cover;
        background-position: center center;
        min-height: 100vh;
    }

    .floating-btn {
        width: 58px;
        height: 58px;
        left: 20px;
    }

    .sunflower-icon {
        width: 38px;
        height: 38px;
    }

    .api-endpoint {
        font-size: 14px;
        padding: 14px 18px;
    }

    .welcome-icon {
        font-size: 72px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .editor-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bot-details {
        grid-template-columns: 1fr;
    }
    
    /* 配置管理器手机端优化 */
    .config-item {
        padding: 12px 10px; /* 减小内边距，增加可操作区域 */
        margin-bottom: 12px; /* 减小间距 */
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px; /* 减小间距 */
    }
    
    .config-item-title,
    .config-item-name {
        font-size: 14px; /* 减小字体 */
        text-align: center;
        width: 100%;
        font-weight: 500;
    }
    
    .config-item-desc {
        font-size: 12px; /* 减小字体 */
        text-align: center;
        width: 100%;
    }
    
    .config-item-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .sub-config-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 16px;
    }
    
    .sub-config-item {
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 12px 10px; /* 减小内边距 */
        margin-bottom: 10px; /* 减小间距 */
    }
    
    .sub-config-name {
        font-size: 14px; /* 减小字体 */
        font-weight: 500;
    }
    
    .sub-config-desc {
        font-size: 12px; /* 减小字体 */
    }
    
    /* 系统状态卡片手机端优化 */
    .system-status-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch; /* 拉伸填满宽度 */
        gap: 10px; /* 减小间距 */
        padding: 8px 6px; /* 减小左右内边距，增加可操作区域 */
    }
    
    .status-card-large {
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 12px 10px; /* 减小内边距 */
        margin: 0; /* 移除外边距 */
    }
    
    .status-card-header h3 {
        font-size: 14px; /* 减小字体 */
        text-align: center;
        font-weight: 500;
        margin-bottom: 8px; /* 减小间距 */
    }
    
    .status-card-content {
        text-align: center;
    }
    
    /* 手机端标题缩小，给操作区更多空间 */
    .welcome-title {
        font-size: clamp(20px, 3.5vw, 28px); /* 进一步缩小标题 */
        margin-bottom: 8px; /* 减少底部间距 */
        line-height: 1.3;
    }
    
    .welcome-desc {
        font-size: 13px; /* 进一步缩小描述文字 */
        margin-bottom: 16px; /* 减少底部间距 */
        line-height: 1.4;
    }
    
    .system-status-header h1 {
        font-size: clamp(20px, 3.5vw, 28px); /* 进一步缩小系统状态标题 */
        margin-bottom: 10px; /* 减少底部间距 */
        line-height: 1.3;
    }
    
    .system-status-header p {
        font-size: 12px; /* 进一步缩小描述文字 */
        margin-bottom: 12px; /* 减少底部间距 */
        line-height: 1.4;
    }
    
    /* 文字颜色优化，确保可见性 */
    .text-primary,
    .welcome-title,
    .welcome-desc {
        color: var(--text-primary);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }
    
    /* API卡片手机端优化 */
    .api-item {
        padding: 16px;
        text-align: center;
        font-size: 14px;
    }
    
    /* 聊天界面手机端优化 */
    .ai-chat-container {
        padding: 16px;
    }
    
    .ai-chat-header {
        text-align: center;
    }
    
    .ai-chat-title {
        font-size: 18px;
        text-align: center;
    }
    
    .ai-chat-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 减小基础字体 */
    :root {
        font-size: 13px; /* 进一步减小基础字体 */
    }
    
    body {
        font-size: 13px; /* 确保body字体也减小 */
    }
    
    .btn {
        font-size: 13px; /* 减小按钮字体 */
        padding: 10px 16px; /* 减小按钮内边距 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 40px; /* 保持足够的点击区域 */
    }
    
    /* 配置表单容器优化 */
    .config-form {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* 防止水平滚动 */
    }
    
    /* 确保所有表单元素都在容器内 */
    .config-form * {
        max-width: 100%;
    }
    
    /* 优化ArrayForm在移动端的显示 */
    .config-form-arrayform {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 12px 0;
    }
    
    /* 优化SubForm在移动端的显示 */
    .config-form-subform {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 优化输入组件的移动端体验 */
    .config-form-input,
    .config-form-select,
    .config-form-textarea,
    .config-form-number {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* 优化多选组件 */
    .config-form-multiselect {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* ==================== 特殊效果 ==================== */
@supports (-webkit-touch-callout: none) {
    .app-container {
        height: -webkit-fill-available;
    }
    
    .sidebar {
        height: 100vh;
        height: -webkit-fill-available;
    }
}

body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* 打印样式 */
@media print {
    .floating-btn,
    .sidebar,
    .theme-toggle,
    .editor-controls,
    .button-group,
    #toastContainer {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .content {
        padding: 0;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --accent: #4d90fe;
        --success: #0f9d58;
        --danger: #d23f31;
        --warning: #f4b400;
    }
}

/* ==================== 欢迎界面优化 ==================== */
/* 系统状态页面的welcome-screen特殊样式 */
#systemStatusPage.welcome-screen {
    text-align: center;
    padding: 20px 12px; /* 减小内边距，充分利用屏幕 */
    padding-bottom: 60px;
    animation: welcomeFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 系统状态页面样式 */
.system-status-header {
    margin-bottom: 40px;
    text-align: center;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 16px; /* 缩小间距，充分利用空间 */
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px; /* 大幅减小内边距，充分利用屏幕 */
    padding-bottom: 32px; /* 缩小底部间距 */
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* ==================== 统一卡片样式规范 ==================== */
/* 所有卡片使用统一的样式变量，确保主题切换时样式统一 */
.status-card-large {
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--border); /* 统一边框样式 */
    border-radius: var(--radius-lg);
    padding: 20px; /* 统一内边距 */
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    animation: cardSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* 亮色主题：状态卡片统一样式 */
body.light .status-card-large {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.status-card-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 164, 96, 0.1), transparent);
    transition: left 0.6s ease;
    z-index: 0;
}

.status-card-large:hover::before {
    left: 100%;
}

.status-card-large > * {
    position: relative;
    z-index: 1;
}

.status-card-large:nth-child(1) { animation-delay: 0.05s; }
.status-card-large:nth-child(2) { animation-delay: 0.1s; }
.status-card-large:nth-child(3) { animation-delay: 0.15s; }
.status-card-large:nth-child(4) { animation-delay: 0.2s; }
.status-card-large:nth-child(5) { animation-delay: 0.25s; }
.status-card-large:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.status-card-large:hover {
    transform: translateY(-6px) scale(1.01); /* 统一悬停效果 */
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    background: var(--bg-hover); /* 使用统一的悬停背景 */
}

.status-card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.status-card-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-pink);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-card-large:hover .status-card-header::after {
    width: 100%;
}

.status-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.status-card-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    padding-left: 0;
}

.status-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.status-item:hover {
    padding-left: 12px;
    background: linear-gradient(90deg, var(--accent-light), transparent);
    border-radius: var(--radius-sm);
    margin: 0 -12px;
    padding-right: 12px;
}

.status-item:hover::before {
    width: 4px;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    font-weight: 500;
}

.status-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

/* 内存图表 */
.memory-chart {
    margin: 16px 0;
}

.memory-bar {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.memory-fill {
    height: 100%;
    background: var(--gradient-pink);
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.memory-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: var(--radius-sm);
}

.memory-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.memory-fill.process {
    background: var(--gradient-primary);
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.memory-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.memory-percent {
    font-weight: 600;
    color: var(--accent);
}

/* 网络信息 */
.network-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.network-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
    transition: left 0.5s ease;
}

.network-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.network-item:hover::before {
    left: 100%;
}

.network-item:last-child {
    margin-bottom: 0;
}

.network-name {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 15px;
}

.network-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 机器人状态列表 */
.bot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.bot-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.bot-status-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(244, 164, 96, 0.2);
}

.bot-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

.bot-status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success-light);
}

.bot-status-indicator.offline {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bot-status-info {
    flex: 1;
    min-width: 0;
}

.bot-status-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.bot-status-details {
    font-size: 12px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

/* 重复的welcomeFadeIn已在上方定义，此处删除 */

.welcome-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 36px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.welcome-desc {
    font-size: 18px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 48px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    transition: all var(--transition-base);
}

.stat-label {
    font-size: 14px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.quick-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent-light);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.quick-action:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent);
    box-shadow: var(--shadow-xl);
    color: var(--accent);
}

.quick-action:hover::before {
    width: 300px;
    height: 300px;
}

.quick-action-icon {
    font-size: 48px;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-base);
}

.quick-action:hover .quick-action-icon {
    transform: scale(1.1) rotate(5deg);
}

.quick-action-text {
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ==================== 配置编辑器样式 ==================== */
.config-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2), 0 4px 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.config-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.15));
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.config-editor-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.config-editor-title::before {
    content: '⚙️';
    font-size: 20px;
}

.config-editor-controls {
    display: flex;
    gap: 12px;
}

.config-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 0;
    position: relative;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.config-list-panel {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
    min-height: 0;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.config-list-panel::-webkit-scrollbar {
    width: 8px;
}

.config-list-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
}

.config-list-panel::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.config-list-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.config-list-loading,
.config-list-empty,
.config-list-error {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-size: 16px;
}

.config-list-loading::before {
    content: '⏳';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

.config-list-empty::before {
    content: '📝';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.config-list-error::before {
    content: '❌';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.config-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px; /* 统一内边距 */
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    border: 2px solid var(--border); /* 统一边框样式 */
    border-radius: var(--radius-lg); /* 统一圆角 */
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* 亮色主题：配置项统一样式 */
body.light .config-item {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.config-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.config-item:hover {
    background: var(--bg-hover); /* 使用统一的悬停背景 */
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.01); /* 统一悬停效果 */
    box-shadow: var(--shadow-lg);
}

.config-item:hover::before {
    transform: scaleY(1);
}

.config-item-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-base);
}

.config-item:hover .config-item-icon {
    transform: scale(1.1) rotate(5deg);
}

.config-item-info {
    flex: 1;
    min-width: 0;
}

.config-item-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    /* 暗色主题：深色阴影增强可读性 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* 亮色主题：浅色阴影增强可读性 */
body.light .config-item-name {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.config-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--accent);
}

.config-item-desc {
    font-size: 14px;
    color: var(--text-primary);
    /* 暗色主题：深色阴影增强可读性 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 6px;
    line-height: 1.5;
}

/* 亮色主题：浅色阴影增强可读性 */
body.light .config-item-desc {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.config-item-path {
    font-size: 12px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.config-item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.config-item-actions .btn {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.config-item-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.config-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px; /* 统一内边距 */
    overflow: hidden;
    background: transparent; /* 面板本身透明，让内部卡片显示 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.config-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 20px; /* 统一内边距 */
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-lg); /* 统一圆角 */
    border: 2px solid var(--border); /* 统一边框样式 */
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4); /* 统一阴影 */
}

/* 亮色主题：编辑器工具栏统一样式 */
body.light .config-editor-toolbar {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.config-editor-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 配置编辑器名称图标 - 使用线条装饰替代emoji */
.config-editor-name::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background: var(--gradient-pink);
    border-radius: 4px;
    position: relative;
    vertical-align: middle;
    animation: iconPulse 2s ease-in-out infinite;
}

.config-editor-name::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-primary);
    border-radius: 2px;
    box-sizing: border-box;
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.config-editor-actions {
    display: flex;
    gap: 12px;
}

.config-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0;
    min-height: 0; /* 修复 flex 子元素滚动问题 */
    position: relative;
    height: 100%;
    max-height: 100%;
    /* 确保底部内容可见 */
    padding-bottom: 0;
    margin-bottom: 0;
}

.config-editor-textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    outline: none;
    transition: all var(--transition-base);
}

.config-editor-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.config-editor-content .CodeMirror {
    flex: 1;
    height: 100%;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.8;
}

.config-editor-content .CodeMirror-focused {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==================== 可视化配置表单样式 ==================== */
.config-form-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 100%;
}

.config-form-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-right: 12px;
    padding-bottom: 80px; /* 大幅增加底部内边距，确保能滚动到底部并看到所有内容 */
    min-height: 0;
    max-height: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
    overscroll-behavior: contain; /* 防止滚动链 */
    box-sizing: border-box;
    scroll-behavior: smooth;
    /* 确保内容区域有足够空间 */
    margin-bottom: 20px;
}

.config-form-scroll::-webkit-scrollbar {
    width: 8px;
}

.config-form-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
}

.config-form-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.config-form-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.config-form-field {
    margin-bottom: 24px;
    padding: 20px; /* 统一内边距 */
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-lg); /* 统一圆角 */
    border: 2px solid var(--border); /* 统一边框样式 */
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4); /* 统一阴影 */
    transition: all var(--transition-base);
}

/* 亮色主题：表单字段统一样式 */
body.light .config-form-field {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.config-form-field:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover); /* 使用统一的悬停背景 */
}

.config-form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.config-form-required {
    color: var(--danger);
    margin-left: 4px;
}

.config-form-hint {
    font-size: 13px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    line-height: 1.5;
}

.config-form-input,
.config-form-select {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
    box-sizing: border-box; /* 确保padding包含在宽度内 */
    -webkit-appearance: none; /* 移除iOS默认样式 */
    appearance: none;
}

.config-form-input:focus,
.config-form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.config-form-input::placeholder {
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.config-form-number {
    -moz-appearance: textfield;
    appearance: textfield;
}

.config-form-number::-webkit-outer-spin-button,
.config-form-number::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.config-form-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.config-form-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.config-form-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    transition: all var(--transition-base);
    border-radius: 28px;
}

.config-form-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: all var(--transition-base);
    border-radius: 50%;
}

.config-form-checkbox:checked + .config-form-switch-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

.config-form-checkbox:checked + .config-form-switch-slider:before {
    transform: translateX(24px);
    background-color: white;
}

.config-form-subform {
    padding: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 12px;
}

.config-form-subfield {
    margin-bottom: 16px;
}

.config-form-subfield:last-child {
    margin-bottom: 0;
}

.config-form-array {
    margin-top: 12px;
}

.config-form-array-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.config-form-array-item input {
    flex: 1;
}

.config-form-array-add {
    margin-top: 12px;
}

.config-form-array-remove {
    flex-shrink: 0;
}

/* ============ ArrayForm（对象数组） ============ */
.config-form-arrayform {
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* 防止内容溢出 */
}

.config-form-arrayform-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    margin-left: 0;
    margin-right: 0;
    min-height: 80px; /* 确保卡片不会太小 */
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all var(--transition-base);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* 确保padding包含在宽度内 */
}

.config-form-arrayform-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.config-form-arrayform-item .config-form-subfield {
    margin-bottom: 10px;
}

.config-form-arrayform-item .config-form-subfield:last-child {
    margin-bottom: 0;
}

.config-form-arrayform-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap; /* 移动端允许换行 */
}

.config-form-arrayform-add {
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
    min-height: 48px; /* 确保添加按钮足够大 */
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    touch-action: manipulation; /* 优化触摸响应 */
    transition: all var(--transition-base);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box; /* 确保padding包含在宽度内 */
}

.config-form-arrayform-add:active {
    transform: scale(0.98);
}

/* ==================== Tags 组件样式 ==================== */
.config-form-tags {
    margin-top: 12px;
}

.config-form-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 32px;
}

.config-form-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 16px;
    font-size: 13px;
    color: var(--accent);
    transition: all var(--transition-base);
}

.config-form-tag-item:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.config-form-tag-text {
    user-select: none;
}

.config-form-tag-remove {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.config-form-tag-item:hover .config-form-tag-remove {
    background: rgba(255, 255, 255, 0.2);
}

.config-form-tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.config-form-tags-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.config-form-tags-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
    min-width: 0; /* 允许flex item缩小 */
    box-sizing: border-box;
    width: 100%;
}

.config-form-tags-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.config-form-tags-add {
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 80px; /* 确保按钮有最小宽度 */
}

.sub-config-list-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 100%;
    padding-bottom: 80px; /* 大幅增加底部内边距，确保能滚动到底部 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    scroll-behavior: smooth;
    margin-bottom: 20px;
}

.sub-config-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    padding-bottom: 24px;
    min-height: fit-content;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sub-config-item {
    padding: 20px; /* 统一内边距 */
    min-height: 140px; /* 设置最小高度，让卡片更长 */
    background: var(--bg-card); /* 使用统一的卡片背景色 */
    border: 2px solid var(--border); /* 统一边框样式 */
    border-radius: var(--radius-lg); /* 统一圆角 */
    cursor: pointer;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    text-align: center;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-sizing: border-box;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* 亮色主题：子配置项统一样式 */
body.light .sub-config-item {
    border: 2px solid var(--border);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(230, 57, 155, 0.2);
}

.sub-config-item:hover {
    border-color: var(--accent);
    transform: translateY(-6px) scale(1.01); /* 统一悬停效果 */
    box-shadow: var(--shadow-lg);
    background: var(--bg-hover); /* 使用统一的悬停背景 */
}

/* 子配置图标 - 使用动画线条替代emoji */
.sub-config-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: block;
    position: relative;
    background: var(--gradient-pink);
    border-radius: 50%;
    animation: iconRotate 3s linear infinite;
}

.sub-config-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid var(--text-primary);
    border-radius: 50%;
    box-sizing: border-box;
}

.sub-config-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sub-config-info {
    flex: 1;
    min-width: 0;
}

.sub-config-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    /* 暗色主题：深色阴影增强可读性 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* 亮色主题：浅色阴影增强可读性 */
body.light .sub-config-name {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.sub-config-desc {
    font-size: 13px;
    color: var(--text-primary);
    /* 暗色主题：深色阴影增强可读性 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
    line-height: 1.4;
}

/* 亮色主题：浅色阴影增强可读性 */
body.light .sub-config-desc {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.sub-config-path {
    font-size: 11px;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* ==================== 优化聊天消息样式 ==================== */
.chat-msg.assistant.asr-streaming {
    border-style: dashed;
    border-color: var(--accent);
    background: var(--accent-light);
    animation: asrPulse 1.5s ease-in-out infinite;
}

@keyframes asrPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* ==================== 优化按钮样式 ==================== */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-sm span:first-child {
    margin-right: 6px;
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}